var e = require("../../../../../common/vendor.js"), t = require("../js/z-paging-static.js"), i = require("../js/z-paging-utils.js"), s = require("../js/z-paging-enum.js");

require("../config/index.js"), require("../js/z-paging-constant.js");

var r = {
    name: "z-paging-refresh",
    data: function() {
        return {
            R: s.Enum.Refresher,
            isIos: "ios" === e.index.getSystemInfoSync().platform,
            refresherTimeText: "",
            zTheme: {
                title: {
                    white: "#efefef",
                    black: "#555555"
                },
                arrow: {
                    white: t.zStatic.base64ArrowWhite,
                    black: t.zStatic.base64Arrow
                },
                flower: {
                    white: t.zStatic.base64FlowerWhite,
                    black: t.zStatic.base64Flower
                },
                success: {
                    white: t.zStatic.base64SuccessWhite,
                    black: t.zStatic.base64Success
                },
                indicator: {
                    white: "#eeeeee",
                    black: "#777777"
                }
            }
        };
    },
    props: [ "status", "defaultThemeStyle", "defaultText", "pullingText", "refreshingText", "completeText", "defaultImg", "pullingImg", "refreshingImg", "completeImg", "refreshingAnimated", "showUpdateTime", "updateTimeKey", "imgStyle", "titleStyle", "updateTimeStyle", "updateTimeTextMap" ],
    computed: {
        ts: function() {
            return this.defaultThemeStyle;
        },
        statusTextArr: function() {
            return this.updateTime(), [ this.defaultText, this.pullingText, this.refreshingText, this.completeText ];
        },
        currentTitle: function() {
            return this.statusTextArr[this.status] || this.defaultText;
        },
        leftImageClass: function() {
            return this.status === this.R.Complete ? "zp-r-left-image-pre-size" : "zp-r-left-image zp-r-left-image-pre-size " + (this.status === this.R.Default ? "zp-r-arrow-down" : "zp-r-arrow-top");
        },
        leftImageStyle: function() {
            var e = this.showUpdateTime, t = e ? "36rpx" : "30rpx";
            return {
                width: t,
                height: t,
                "margin-right": e ? "20rpx" : "9rpx"
            };
        },
        leftImageSrc: function() {
            var e = this.R, t = this.status;
            return t === e.Default ? this.defaultImg ? this.defaultImg : this.zTheme.arrow[this.ts] : t === e.ReleaseToRefresh ? this.pullingImg ? this.pullingImg : this.defaultImg ? this.defaultImg : this.zTheme.arrow[this.ts] : t === e.Loading ? this.refreshingImg ? this.refreshingImg : this.zTheme.flower[this.ts] : t === e.Complete ? this.completeImg ? this.completeImg : this.zTheme.success[this.ts] : "";
        },
        rightTextStyle: function() {
            var e = {};
            return e.color = this.zTheme.title[this.ts], e;
        }
    },
    methods: {
        updateTime: function() {
            this.showUpdateTime && (this.refresherTimeText = i.u.getRefesrherFormatTimeByKey(this.updateTimeKey, this.updateTimeTextMap));
        }
    }
}, a = e._export_sfc(r, [ [ "render", function(t, i, s, r, a, h) {
    return e.e({
        a: s.status !== a.R.Loading
    }, s.status !== a.R.Loading ? {
        b: e.n(h.leftImageClass),
        c: e.s(h.leftImageStyle),
        d: e.s(s.imgStyle),
        e: h.leftImageSrc
    } : {
        f: s.refreshingAnimated ? 1 : "",
        g: e.s(h.leftImageStyle),
        h: e.s(s.imgStyle),
        i: h.leftImageSrc
    }, {
        j: e.t(h.currentTitle),
        k: e.s(h.rightTextStyle),
        l: e.s(s.titleStyle),
        m: s.showUpdateTime && a.refresherTimeText.length
    }, s.showUpdateTime && a.refresherTimeText.length ? {
        n: e.t(a.refresherTimeText),
        o: e.s(h.rightTextStyle),
        p: e.s(s.updateTimeStyle)
    } : {}, {
        q: e.n(s.showUpdateTime ? "zp-r-container zp-r-container-padding" : "zp-r-container")
    });
} ], [ "__scopeId", "data-v-a5470c58" ] ]);

wx.createComponent(a);